package com.ruoyi.order.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.order.mapper.MallOrderReturnReasonMapper;
import com.ruoyi.order.domain.MallOrderReturnReason;
import com.ruoyi.order.service.IMallOrderReturnReasonService;

/**
 * 退货原因Service业务层处理
 * 
 * @author cws
 * @date 2024-11-30
 */
@Service
public class MallOrderReturnReasonServiceImpl implements IMallOrderReturnReasonService 
{
    @Autowired
    private MallOrderReturnReasonMapper mallOrderReturnReasonMapper;

    /**
     * 查询退货原因
     * 
     * @param id 退货原因主键
     * @return 退货原因
     */
    @Override
    public MallOrderReturnReason selectMallOrderReturnReasonById(Long id)
    {
        return mallOrderReturnReasonMapper.selectMallOrderReturnReasonById(id);
    }

    /**
     * 查询退货原因列表
     * 
     * @param mallOrderReturnReason 退货原因
     * @return 退货原因
     */
    @Override
    public List<MallOrderReturnReason> selectMallOrderReturnReasonList(MallOrderReturnReason mallOrderReturnReason)
    {
        return mallOrderReturnReasonMapper.selectMallOrderReturnReasonList(mallOrderReturnReason);
    }

    /**
     * 新增退货原因
     * 
     * @param mallOrderReturnReason 退货原因
     * @return 结果
     */
    @Override
    public int insertMallOrderReturnReason(MallOrderReturnReason mallOrderReturnReason)
    {
        mallOrderReturnReason.setCreateTime(DateUtils.getNowDate());
        return mallOrderReturnReasonMapper.insertMallOrderReturnReason(mallOrderReturnReason);
    }

    /**
     * 修改退货原因
     * 
     * @param mallOrderReturnReason 退货原因
     * @return 结果
     */
    @Override
    public int updateMallOrderReturnReason(MallOrderReturnReason mallOrderReturnReason)
    {
        return mallOrderReturnReasonMapper.updateMallOrderReturnReason(mallOrderReturnReason);
    }

    /**
     * 批量删除退货原因
     * 
     * @param ids 需要删除的退货原因主键
     * @return 结果
     */
    @Override
    public int deleteMallOrderReturnReasonByIds(Long[] ids)
    {
        return mallOrderReturnReasonMapper.deleteMallOrderReturnReasonByIds(ids);
    }

    /**
     * 删除退货原因信息
     * 
     * @param id 退货原因主键
     * @return 结果
     */
    @Override
    public int deleteMallOrderReturnReasonById(Long id)
    {
        return mallOrderReturnReasonMapper.deleteMallOrderReturnReasonById(id);
    }
}
